import type { FormProps as ElFormProps, FormItemProps, RowProps, ColProps, FormItemRule } from "element-plus";
import { Component } from "vue";
export type ComType =
  | "button"
  | "autocomplete"
  | "cascader"
  | "checkbox"
  | "datePicker"
  | "input"
  | "number"
  | "rate"
  | "slider"
  | "switch"
  | "tree-select"
  | "color-picker"
  | "radio-group"
  | "radio-button-group"
  | "check-group"
  | "select"
  | "api-select"
  | "input-color-picker"
  | "icon-picker";
interface FormColumnProps {
  field: String;
  label: String;
  labelWidth?: String;
  span?: Number;
  required?: Boolean;
  disabled?: Boolean | ((formModel: any) => Boolean);
  readonly?: Boolean | ((formModel: any) => Boolean);
  ifShow?: Boolean | ((formModel: any) => Boolean);
  rule?: FormItemRule;
  el?: ComType | Component;
  defaultValue?: any;
  elProps?: Object;
  colProps?: Partial<ColProps>;
  formItemProps?: Partial<FormItemProps>;
  render?: (formModel: any, schema: SchemaProps) => Component;
}
export type SchemaProps = Partial<FormColumnProps>;

export interface FormProps extends ElFormProps {
  schemas: SchemaProps[];
  rowProps?: Partial<RowProps>;
}
